/**
 * @description  : 基础实体类
 * @descriptionDetail : 基础实体类
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-10-03 15:45:44
 */
export default  {

  createNew: function() {
    let baseEntity = {};
    baseEntity.id = ""; // 主键ID
    baseEntity.toJsonStr = function() {
      let self = this;
      let jsonTmp = {};
      Object.keys(self).forEach(key => {
        if(key != 'id' && key != 'createTime'){
          jsonTmp[key] = self[key];
        }
      });
      return JSON.stringify(jsonTmp);
    };
    baseEntity.updateContent = function(tmp) {
      let self = this;
      Object.keys(self).forEach(key => {
        if(typeof self[key] != 'function'){
          self[key] = tmp[key];
        }
      });
    };
    baseEntity.updateTime = function(){
      this.createTime = (Date.now() / 1000) + '';
    };
    return baseEntity;
  },

}
